<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>请假申请</title>
</head>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<body>
	<div id="index">
		<el-input v-model="input" placeholder="请输入内容"></el-input>
		<el-select v-model="person" placeholder="请选择">
    		<el-option
		      v-for="item in options"
		      :key="item.value"
		      :label="item.label"
		      :value="item.value">
    		</el-option>
  		</el-select>
  		<button @click='apply'>申请</button>
	</div>
	<script type="text/javascript">
		new Vue({
			el : '#index',
			data : {
				input:'',
				options:[
				         {value: '测试员工A', label: '测试员工A'},
				         {value: '测试员工B', label: '测试员工B'}
				        ],
				person:''
			},
			methods: {
				apply(){
					$.get("./leaveApply/applyFlow/"+this.input+"/"+this.person).then(res=>{
						console.log(res);
						if("1"==res.code){
							alert("申请成功！");
						}else{
							alert("申请失败！");
						}
					},error=>{
						alert(error.responseJSON.msg);
					})
				}   
			}
		})
	</script>
</body>
</html>